#include "ANN_Header.h"

namespace ann
{
	OutputNode::OutputNode(void): m_outData(0.0)
	{
	}
	
	
	OutputNode::~OutputNode(void)
	{
	}

	void OutputNode::Update()
	{
        std::list<Tube*>::iterator inBeginItr = this->GetInTubeBeginItr();
		std::list<Tube*>::iterator inEndItr = this->GetInTubeEndItr();
        double _sValue = 0.0;

		for ( ; inBeginItr != inEndItr; ++inBeginItr)
		{
            _sValue += (*inBeginItr)->GetValue() * (*inBeginItr)->GetWeight();
		}

        _sValue = ann::Tansig(_sValue);

		m_outData = _sValue;
		this->SetValue( _sValue );

		return;
	}
}
